<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableProjectBid class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableProjectBid object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableProjectBidMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableProjectBid $TableProjectBid the actual TableProjectBid data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $UserIdControl
	 * property-read QLabel $UserIdLabel
	 * property QListBox $ProjectIdControl
	 * property-read QLabel $ProjectIdLabel
	 * property QIntegerTextBox $BuyerIdControl
	 * property-read QLabel $BuyerIdLabel
	 * property QIntegerTextBox $BidControl
	 * property-read QLabel $BidLabel
	 * property QIntegerTextBox $DayToCompleteControl
	 * property-read QLabel $DayToCompleteLabel
	 * property QIntegerTextBox $DayPeriodBeforeStartingControl
	 * property-read QLabel $DayPeriodBeforeStartingLabel
	 * property QTextBox $CommentControl
	 * property-read QLabel $CommentLabel
	 * property QTextBox $SendmailControl
	 * property-read QLabel $SendmailLabel
	 * property QTextBox $EnableControl
	 * property-read QLabel $EnableLabel
	 * property QDateTimePicker $BidDateControl
	 * property-read QLabel $BidDateLabel
	 * property QDateTimePicker $RetractDateControl
	 * property-read QLabel $RetractDateLabel
	 * property QTextBox $WonControl
	 * property-read QLabel $WonLabel
	 * property QTextBox $RetractControl
	 * property-read QLabel $RetractLabel
	 * property QIntegerTextBox $StatusControl
	 * property-read QLabel $StatusLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableProjectBidMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableProjectBid;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableProjectBid's individual data fields
		protected $lblId;
		protected $lstUser;
		protected $lstProject;
		protected $txtBuyerId;
		protected $txtBid;
		protected $txtDayToComplete;
		protected $txtDayPeriodBeforeStarting;
		protected $txtComment;
		protected $txtSendmail;
		protected $txtEnable;
		protected $calBidDate;
		protected $calRetractDate;
		protected $txtWon;
		protected $txtRetract;
		protected $txtStatus;

		// Controls that allow the viewing of TableProjectBid's individual data fields
		protected $lblUserId;
		protected $lblProjectId;
		protected $lblBuyerId;
		protected $lblBid;
		protected $lblDayToComplete;
		protected $lblDayPeriodBeforeStarting;
		protected $lblComment;
		protected $lblSendmail;
		protected $lblEnable;
		protected $lblBidDate;
		protected $lblRetractDate;
		protected $lblWon;
		protected $lblRetract;
		protected $lblStatus;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableProjectBidMetaControl to edit a single TableProjectBid object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableProjectBid object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectBidMetaControl
		 * @param TableProjectBid $objTableProjectBid new or existing TableProjectBid object
		 */
		 public function __construct($objParentObject, TableProjectBid $objTableProjectBid) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableProjectBidMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableProjectBid object
			$this->objTableProjectBid = $objTableProjectBid;

			// Figure out if we're Editing or Creating New
			if ($this->objTableProjectBid->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectBidMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableProjectBid object creation - defaults to CreateOrEdit
 		 * @return TableProjectBidMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableProjectBid = TableProjectBid::Load($intId);

				// TableProjectBid was found -- return it!
				if ($objTableProjectBid)
					return new TableProjectBidMetaControl($objParentObject, $objTableProjectBid);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableProjectBid object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableProjectBidMetaControl($objParentObject, new TableProjectBid());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectBidMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableProjectBid object creation - defaults to CreateOrEdit
		 * @return TableProjectBidMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableProjectBidMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableProjectBidMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableProjectBid object creation - defaults to CreateOrEdit
		 * @return TableProjectBidMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableProjectBidMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableProjectBid->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstUser
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUser_Create($strControlId = null) {
			$this->lstUser = new QListBox($this->objParentObject, $strControlId);
			$this->lstUser->Name = QApplication::Translate('User');
			$this->lstUser->Required = true;
			if (!$this->blnEditMode)
				$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserArray = TableUserProject::LoadAll();
			if ($objUserArray) foreach ($objUserArray as $objUser) {
				$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
				if (($this->objTableProjectBid->User) && ($this->objTableProjectBid->User->Id == $objUser->Id))
					$objListItem->Selected = true;
				$this->lstUser->AddItem($objListItem);
			}
			return $this->lstUser;
		}

		/**
		 * Create and setup QLabel lblUserId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserId_Create($strControlId = null) {
			$this->lblUserId = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserId->Name = QApplication::Translate('User');
			$this->lblUserId->Text = ($this->objTableProjectBid->User) ? $this->objTableProjectBid->User->__toString() : null;
			$this->lblUserId->Required = true;
			return $this->lblUserId;
		}

		/**
		 * Create and setup QListBox lstProject
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstProject_Create($strControlId = null) {
			$this->lstProject = new QListBox($this->objParentObject, $strControlId);
			$this->lstProject->Name = QApplication::Translate('Project');
			$this->lstProject->Required = true;
			if (!$this->blnEditMode)
				$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
			$objProjectArray = TableProject::LoadAll();
			if ($objProjectArray) foreach ($objProjectArray as $objProject) {
				$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
				if (($this->objTableProjectBid->Project) && ($this->objTableProjectBid->Project->Id == $objProject->Id))
					$objListItem->Selected = true;
				$this->lstProject->AddItem($objListItem);
			}
			return $this->lstProject;
		}

		/**
		 * Create and setup QLabel lblProjectId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblProjectId_Create($strControlId = null) {
			$this->lblProjectId = new QLabel($this->objParentObject, $strControlId);
			$this->lblProjectId->Name = QApplication::Translate('Project');
			$this->lblProjectId->Text = ($this->objTableProjectBid->Project) ? $this->objTableProjectBid->Project->__toString() : null;
			$this->lblProjectId->Required = true;
			return $this->lblProjectId;
		}

		/**
		 * Create and setup QIntegerTextBox txtBuyerId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtBuyerId_Create($strControlId = null) {
			$this->txtBuyerId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtBuyerId->Name = QApplication::Translate('Buyer Id');
			$this->txtBuyerId->Text = $this->objTableProjectBid->BuyerId;
			$this->txtBuyerId->Required = true;
			return $this->txtBuyerId;
		}

		/**
		 * Create and setup QLabel lblBuyerId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblBuyerId_Create($strControlId = null, $strFormat = null) {
			$this->lblBuyerId = new QLabel($this->objParentObject, $strControlId);
			$this->lblBuyerId->Name = QApplication::Translate('Buyer Id');
			$this->lblBuyerId->Text = $this->objTableProjectBid->BuyerId;
			$this->lblBuyerId->Required = true;
			$this->lblBuyerId->Format = $strFormat;
			return $this->lblBuyerId;
		}

		/**
		 * Create and setup QIntegerTextBox txtBid
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtBid_Create($strControlId = null) {
			$this->txtBid = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtBid->Name = QApplication::Translate('Bid');
			$this->txtBid->Text = $this->objTableProjectBid->Bid;
			$this->txtBid->Required = true;
			return $this->txtBid;
		}

		/**
		 * Create and setup QLabel lblBid
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblBid_Create($strControlId = null, $strFormat = null) {
			$this->lblBid = new QLabel($this->objParentObject, $strControlId);
			$this->lblBid->Name = QApplication::Translate('Bid');
			$this->lblBid->Text = $this->objTableProjectBid->Bid;
			$this->lblBid->Required = true;
			$this->lblBid->Format = $strFormat;
			return $this->lblBid;
		}

		/**
		 * Create and setup QIntegerTextBox txtDayToComplete
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtDayToComplete_Create($strControlId = null) {
			$this->txtDayToComplete = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtDayToComplete->Name = QApplication::Translate('Day To Complete');
			$this->txtDayToComplete->Text = $this->objTableProjectBid->DayToComplete;
			$this->txtDayToComplete->Required = true;
			return $this->txtDayToComplete;
		}

		/**
		 * Create and setup QLabel lblDayToComplete
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblDayToComplete_Create($strControlId = null, $strFormat = null) {
			$this->lblDayToComplete = new QLabel($this->objParentObject, $strControlId);
			$this->lblDayToComplete->Name = QApplication::Translate('Day To Complete');
			$this->lblDayToComplete->Text = $this->objTableProjectBid->DayToComplete;
			$this->lblDayToComplete->Required = true;
			$this->lblDayToComplete->Format = $strFormat;
			return $this->lblDayToComplete;
		}

		/**
		 * Create and setup QIntegerTextBox txtDayPeriodBeforeStarting
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtDayPeriodBeforeStarting_Create($strControlId = null) {
			$this->txtDayPeriodBeforeStarting = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtDayPeriodBeforeStarting->Name = QApplication::Translate('Day Period Before Starting');
			$this->txtDayPeriodBeforeStarting->Text = $this->objTableProjectBid->DayPeriodBeforeStarting;
			$this->txtDayPeriodBeforeStarting->Required = true;
			return $this->txtDayPeriodBeforeStarting;
		}

		/**
		 * Create and setup QLabel lblDayPeriodBeforeStarting
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblDayPeriodBeforeStarting_Create($strControlId = null, $strFormat = null) {
			$this->lblDayPeriodBeforeStarting = new QLabel($this->objParentObject, $strControlId);
			$this->lblDayPeriodBeforeStarting->Name = QApplication::Translate('Day Period Before Starting');
			$this->lblDayPeriodBeforeStarting->Text = $this->objTableProjectBid->DayPeriodBeforeStarting;
			$this->lblDayPeriodBeforeStarting->Required = true;
			$this->lblDayPeriodBeforeStarting->Format = $strFormat;
			return $this->lblDayPeriodBeforeStarting;
		}

		/**
		 * Create and setup QTextBox txtComment
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtComment_Create($strControlId = null) {
			$this->txtComment = new QTextBox($this->objParentObject, $strControlId);
			$this->txtComment->Name = QApplication::Translate('Comment');
			$this->txtComment->Text = $this->objTableProjectBid->Comment;
			$this->txtComment->MaxLength = TableProjectBid::CommentMaxLength;
			return $this->txtComment;
		}

		/**
		 * Create and setup QLabel lblComment
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblComment_Create($strControlId = null) {
			$this->lblComment = new QLabel($this->objParentObject, $strControlId);
			$this->lblComment->Name = QApplication::Translate('Comment');
			$this->lblComment->Text = $this->objTableProjectBid->Comment;
			return $this->lblComment;
		}

		/**
		 * Create and setup QTextBox txtSendmail
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSendmail_Create($strControlId = null) {
			$this->txtSendmail = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSendmail->Name = QApplication::Translate('Sendmail');
			$this->txtSendmail->Text = $this->objTableProjectBid->Sendmail;
			$this->txtSendmail->MaxLength = TableProjectBid::SendmailMaxLength;
			return $this->txtSendmail;
		}

		/**
		 * Create and setup QLabel lblSendmail
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSendmail_Create($strControlId = null) {
			$this->lblSendmail = new QLabel($this->objParentObject, $strControlId);
			$this->lblSendmail->Name = QApplication::Translate('Sendmail');
			$this->lblSendmail->Text = $this->objTableProjectBid->Sendmail;
			return $this->lblSendmail;
		}

		/**
		 * Create and setup QTextBox txtEnable
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtEnable_Create($strControlId = null) {
			$this->txtEnable = new QTextBox($this->objParentObject, $strControlId);
			$this->txtEnable->Name = QApplication::Translate('Enable');
			$this->txtEnable->Text = $this->objTableProjectBid->Enable;
			$this->txtEnable->Required = true;
			$this->txtEnable->MaxLength = TableProjectBid::EnableMaxLength;
			return $this->txtEnable;
		}

		/**
		 * Create and setup QLabel lblEnable
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblEnable_Create($strControlId = null) {
			$this->lblEnable = new QLabel($this->objParentObject, $strControlId);
			$this->lblEnable->Name = QApplication::Translate('Enable');
			$this->lblEnable->Text = $this->objTableProjectBid->Enable;
			$this->lblEnable->Required = true;
			return $this->lblEnable;
		}

		/**
		 * Create and setup QDateTimePicker calBidDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calBidDate_Create($strControlId = null) {
			$this->calBidDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calBidDate->Name = QApplication::Translate('Bid Date');
			$this->calBidDate->DateTime = $this->objTableProjectBid->BidDate;
			$this->calBidDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calBidDate;
		}

		/**
		 * Create and setup QLabel lblBidDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblBidDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblBidDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblBidDate->Name = QApplication::Translate('Bid Date');
			$this->strBidDateDateTimeFormat = $strDateTimeFormat;
			$this->lblBidDate->Text = sprintf($this->objTableProjectBid->BidDate) ? $this->objTableProjectBid->BidDate->__toString($this->strBidDateDateTimeFormat) : null;
			return $this->lblBidDate;
		}

		protected $strBidDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calRetractDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calRetractDate_Create($strControlId = null) {
			$this->calRetractDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calRetractDate->Name = QApplication::Translate('Retract Date');
			$this->calRetractDate->DateTime = $this->objTableProjectBid->RetractDate;
			$this->calRetractDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calRetractDate;
		}

		/**
		 * Create and setup QLabel lblRetractDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblRetractDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblRetractDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblRetractDate->Name = QApplication::Translate('Retract Date');
			$this->strRetractDateDateTimeFormat = $strDateTimeFormat;
			$this->lblRetractDate->Text = sprintf($this->objTableProjectBid->RetractDate) ? $this->objTableProjectBid->RetractDate->__toString($this->strRetractDateDateTimeFormat) : null;
			return $this->lblRetractDate;
		}

		protected $strRetractDateDateTimeFormat;


		/**
		 * Create and setup QTextBox txtWon
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtWon_Create($strControlId = null) {
			$this->txtWon = new QTextBox($this->objParentObject, $strControlId);
			$this->txtWon->Name = QApplication::Translate('Won');
			$this->txtWon->Text = $this->objTableProjectBid->Won;
			$this->txtWon->MaxLength = TableProjectBid::WonMaxLength;
			return $this->txtWon;
		}

		/**
		 * Create and setup QLabel lblWon
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblWon_Create($strControlId = null) {
			$this->lblWon = new QLabel($this->objParentObject, $strControlId);
			$this->lblWon->Name = QApplication::Translate('Won');
			$this->lblWon->Text = $this->objTableProjectBid->Won;
			return $this->lblWon;
		}

		/**
		 * Create and setup QTextBox txtRetract
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtRetract_Create($strControlId = null) {
			$this->txtRetract = new QTextBox($this->objParentObject, $strControlId);
			$this->txtRetract->Name = QApplication::Translate('Retract');
			$this->txtRetract->Text = $this->objTableProjectBid->Retract;
			$this->txtRetract->MaxLength = TableProjectBid::RetractMaxLength;
			return $this->txtRetract;
		}

		/**
		 * Create and setup QLabel lblRetract
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblRetract_Create($strControlId = null) {
			$this->lblRetract = new QLabel($this->objParentObject, $strControlId);
			$this->lblRetract->Name = QApplication::Translate('Retract');
			$this->lblRetract->Text = $this->objTableProjectBid->Retract;
			return $this->lblRetract;
		}

		/**
		 * Create and setup QIntegerTextBox txtStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtStatus_Create($strControlId = null) {
			$this->txtStatus = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtStatus->Name = QApplication::Translate('Status');
			$this->txtStatus->Text = $this->objTableProjectBid->Status;
			$this->txtStatus->Required = true;
			return $this->txtStatus;
		}

		/**
		 * Create and setup QLabel lblStatus
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblStatus_Create($strControlId = null, $strFormat = null) {
			$this->lblStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblStatus->Name = QApplication::Translate('Status');
			$this->lblStatus->Text = $this->objTableProjectBid->Status;
			$this->lblStatus->Required = true;
			$this->lblStatus->Format = $strFormat;
			return $this->lblStatus;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableProjectBid object.
		 * @param boolean $blnReload reload TableProjectBid from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableProjectBid->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableProjectBid->Id;

			if ($this->lstUser) {
					$this->lstUser->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserArray = TableUserProject::LoadAll();
				if ($objUserArray) foreach ($objUserArray as $objUser) {
					$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
					if (($this->objTableProjectBid->User) && ($this->objTableProjectBid->User->Id == $objUser->Id))
						$objListItem->Selected = true;
					$this->lstUser->AddItem($objListItem);
				}
			}
			if ($this->lblUserId) $this->lblUserId->Text = ($this->objTableProjectBid->User) ? $this->objTableProjectBid->User->__toString() : null;

			if ($this->lstProject) {
					$this->lstProject->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
				$objProjectArray = TableProject::LoadAll();
				if ($objProjectArray) foreach ($objProjectArray as $objProject) {
					$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
					if (($this->objTableProjectBid->Project) && ($this->objTableProjectBid->Project->Id == $objProject->Id))
						$objListItem->Selected = true;
					$this->lstProject->AddItem($objListItem);
				}
			}
			if ($this->lblProjectId) $this->lblProjectId->Text = ($this->objTableProjectBid->Project) ? $this->objTableProjectBid->Project->__toString() : null;

			if ($this->txtBuyerId) $this->txtBuyerId->Text = $this->objTableProjectBid->BuyerId;
			if ($this->lblBuyerId) $this->lblBuyerId->Text = $this->objTableProjectBid->BuyerId;

			if ($this->txtBid) $this->txtBid->Text = $this->objTableProjectBid->Bid;
			if ($this->lblBid) $this->lblBid->Text = $this->objTableProjectBid->Bid;

			if ($this->txtDayToComplete) $this->txtDayToComplete->Text = $this->objTableProjectBid->DayToComplete;
			if ($this->lblDayToComplete) $this->lblDayToComplete->Text = $this->objTableProjectBid->DayToComplete;

			if ($this->txtDayPeriodBeforeStarting) $this->txtDayPeriodBeforeStarting->Text = $this->objTableProjectBid->DayPeriodBeforeStarting;
			if ($this->lblDayPeriodBeforeStarting) $this->lblDayPeriodBeforeStarting->Text = $this->objTableProjectBid->DayPeriodBeforeStarting;

			if ($this->txtComment) $this->txtComment->Text = $this->objTableProjectBid->Comment;
			if ($this->lblComment) $this->lblComment->Text = $this->objTableProjectBid->Comment;

			if ($this->txtSendmail) $this->txtSendmail->Text = $this->objTableProjectBid->Sendmail;
			if ($this->lblSendmail) $this->lblSendmail->Text = $this->objTableProjectBid->Sendmail;

			if ($this->txtEnable) $this->txtEnable->Text = $this->objTableProjectBid->Enable;
			if ($this->lblEnable) $this->lblEnable->Text = $this->objTableProjectBid->Enable;

			if ($this->calBidDate) $this->calBidDate->DateTime = $this->objTableProjectBid->BidDate;
			if ($this->lblBidDate) $this->lblBidDate->Text = sprintf($this->objTableProjectBid->BidDate) ? $this->objTableProjectBid->BidDate->__toString($this->strBidDateDateTimeFormat) : null;

			if ($this->calRetractDate) $this->calRetractDate->DateTime = $this->objTableProjectBid->RetractDate;
			if ($this->lblRetractDate) $this->lblRetractDate->Text = sprintf($this->objTableProjectBid->RetractDate) ? $this->objTableProjectBid->RetractDate->__toString($this->strRetractDateDateTimeFormat) : null;

			if ($this->txtWon) $this->txtWon->Text = $this->objTableProjectBid->Won;
			if ($this->lblWon) $this->lblWon->Text = $this->objTableProjectBid->Won;

			if ($this->txtRetract) $this->txtRetract->Text = $this->objTableProjectBid->Retract;
			if ($this->lblRetract) $this->lblRetract->Text = $this->objTableProjectBid->Retract;

			if ($this->txtStatus) $this->txtStatus->Text = $this->objTableProjectBid->Status;
			if ($this->lblStatus) $this->lblStatus->Text = $this->objTableProjectBid->Status;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEPROJECTBID OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableProjectBid instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableProjectBid() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstUser) $this->objTableProjectBid->UserId = $this->lstUser->SelectedValue;
				if ($this->lstProject) $this->objTableProjectBid->ProjectId = $this->lstProject->SelectedValue;
				if ($this->txtBuyerId) $this->objTableProjectBid->BuyerId = $this->txtBuyerId->Text;
				if ($this->txtBid) $this->objTableProjectBid->Bid = $this->txtBid->Text;
				if ($this->txtDayToComplete) $this->objTableProjectBid->DayToComplete = $this->txtDayToComplete->Text;
				if ($this->txtDayPeriodBeforeStarting) $this->objTableProjectBid->DayPeriodBeforeStarting = $this->txtDayPeriodBeforeStarting->Text;
				if ($this->txtComment) $this->objTableProjectBid->Comment = $this->txtComment->Text;
				if ($this->txtSendmail) $this->objTableProjectBid->Sendmail = $this->txtSendmail->Text;
				if ($this->txtEnable) $this->objTableProjectBid->Enable = $this->txtEnable->Text;
				if ($this->calBidDate) $this->objTableProjectBid->BidDate = $this->calBidDate->DateTime;
				if ($this->calRetractDate) $this->objTableProjectBid->RetractDate = $this->calRetractDate->DateTime;
				if ($this->txtWon) $this->objTableProjectBid->Won = $this->txtWon->Text;
				if ($this->txtRetract) $this->objTableProjectBid->Retract = $this->txtRetract->Text;
				if ($this->txtStatus) $this->objTableProjectBid->Status = $this->txtStatus->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableProjectBid object
				$this->objTableProjectBid->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableProjectBid instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableProjectBid() {
			$this->objTableProjectBid->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableProjectBid': return $this->objTableProjectBid;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableProjectBid fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'UserIdControl':
					if (!$this->lstUser) return $this->lstUser_Create();
					return $this->lstUser;
				case 'UserIdLabel':
					if (!$this->lblUserId) return $this->lblUserId_Create();
					return $this->lblUserId;
				case 'ProjectIdControl':
					if (!$this->lstProject) return $this->lstProject_Create();
					return $this->lstProject;
				case 'ProjectIdLabel':
					if (!$this->lblProjectId) return $this->lblProjectId_Create();
					return $this->lblProjectId;
				case 'BuyerIdControl':
					if (!$this->txtBuyerId) return $this->txtBuyerId_Create();
					return $this->txtBuyerId;
				case 'BuyerIdLabel':
					if (!$this->lblBuyerId) return $this->lblBuyerId_Create();
					return $this->lblBuyerId;
				case 'BidControl':
					if (!$this->txtBid) return $this->txtBid_Create();
					return $this->txtBid;
				case 'BidLabel':
					if (!$this->lblBid) return $this->lblBid_Create();
					return $this->lblBid;
				case 'DayToCompleteControl':
					if (!$this->txtDayToComplete) return $this->txtDayToComplete_Create();
					return $this->txtDayToComplete;
				case 'DayToCompleteLabel':
					if (!$this->lblDayToComplete) return $this->lblDayToComplete_Create();
					return $this->lblDayToComplete;
				case 'DayPeriodBeforeStartingControl':
					if (!$this->txtDayPeriodBeforeStarting) return $this->txtDayPeriodBeforeStarting_Create();
					return $this->txtDayPeriodBeforeStarting;
				case 'DayPeriodBeforeStartingLabel':
					if (!$this->lblDayPeriodBeforeStarting) return $this->lblDayPeriodBeforeStarting_Create();
					return $this->lblDayPeriodBeforeStarting;
				case 'CommentControl':
					if (!$this->txtComment) return $this->txtComment_Create();
					return $this->txtComment;
				case 'CommentLabel':
					if (!$this->lblComment) return $this->lblComment_Create();
					return $this->lblComment;
				case 'SendmailControl':
					if (!$this->txtSendmail) return $this->txtSendmail_Create();
					return $this->txtSendmail;
				case 'SendmailLabel':
					if (!$this->lblSendmail) return $this->lblSendmail_Create();
					return $this->lblSendmail;
				case 'EnableControl':
					if (!$this->txtEnable) return $this->txtEnable_Create();
					return $this->txtEnable;
				case 'EnableLabel':
					if (!$this->lblEnable) return $this->lblEnable_Create();
					return $this->lblEnable;
				case 'BidDateControl':
					if (!$this->calBidDate) return $this->calBidDate_Create();
					return $this->calBidDate;
				case 'BidDateLabel':
					if (!$this->lblBidDate) return $this->lblBidDate_Create();
					return $this->lblBidDate;
				case 'RetractDateControl':
					if (!$this->calRetractDate) return $this->calRetractDate_Create();
					return $this->calRetractDate;
				case 'RetractDateLabel':
					if (!$this->lblRetractDate) return $this->lblRetractDate_Create();
					return $this->lblRetractDate;
				case 'WonControl':
					if (!$this->txtWon) return $this->txtWon_Create();
					return $this->txtWon;
				case 'WonLabel':
					if (!$this->lblWon) return $this->lblWon_Create();
					return $this->lblWon;
				case 'RetractControl':
					if (!$this->txtRetract) return $this->txtRetract_Create();
					return $this->txtRetract;
				case 'RetractLabel':
					if (!$this->lblRetract) return $this->lblRetract_Create();
					return $this->lblRetract;
				case 'StatusControl':
					if (!$this->txtStatus) return $this->txtStatus_Create();
					return $this->txtStatus;
				case 'StatusLabel':
					if (!$this->lblStatus) return $this->lblStatus_Create();
					return $this->lblStatus;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableProjectBid fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'UserIdControl':
						return ($this->lstUser = QType::Cast($mixValue, 'QControl'));
					case 'ProjectIdControl':
						return ($this->lstProject = QType::Cast($mixValue, 'QControl'));
					case 'BuyerIdControl':
						return ($this->txtBuyerId = QType::Cast($mixValue, 'QControl'));
					case 'BidControl':
						return ($this->txtBid = QType::Cast($mixValue, 'QControl'));
					case 'DayToCompleteControl':
						return ($this->txtDayToComplete = QType::Cast($mixValue, 'QControl'));
					case 'DayPeriodBeforeStartingControl':
						return ($this->txtDayPeriodBeforeStarting = QType::Cast($mixValue, 'QControl'));
					case 'CommentControl':
						return ($this->txtComment = QType::Cast($mixValue, 'QControl'));
					case 'SendmailControl':
						return ($this->txtSendmail = QType::Cast($mixValue, 'QControl'));
					case 'EnableControl':
						return ($this->txtEnable = QType::Cast($mixValue, 'QControl'));
					case 'BidDateControl':
						return ($this->calBidDate = QType::Cast($mixValue, 'QControl'));
					case 'RetractDateControl':
						return ($this->calRetractDate = QType::Cast($mixValue, 'QControl'));
					case 'WonControl':
						return ($this->txtWon = QType::Cast($mixValue, 'QControl'));
					case 'RetractControl':
						return ($this->txtRetract = QType::Cast($mixValue, 'QControl'));
					case 'StatusControl':
						return ($this->txtStatus = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>